Skip to content

Switch to official YAML extension by default#1678

Open
krystof-k wants to merge 26 commits into
marcoroth:mainfrom
cloudaper:support-yaml-config-extension
Open

Switch to official YAML extension by default#1678
krystof-k wants to merge 26 commits into
marcoroth:mainfrom
cloudaper:support-yaml-config-extension

Conversation

@krystof-k

@krystof-k krystof-k commented Apr 23, 2026

Copy link
Copy Markdown

Love the work you're doing on Herb — it's a great tool and I'm enjoying using it!

I ran into a small friction point: when I created .herb.yaml instead of .herb.yml, it didn't work — it was actually actively rejected with an error asking me to rename it. Since .yaml is the official YAML extension, it should be the supported (and preferred) variant.

This PR:

  • Removes the .herb.yaml rejection
  • Supports both .herb.yaml and .herb.yml across all three runtimes (JS, Ruby, Rust)
  • Prefers .herb.yaml over .herb.yml if both exist (since it's the official extension)
  • Updates all user-facing strings, docs, READMEs and --init
  • Fully backwards compatible — existing .herb.yml files continue to work without any changes
  • Tests updated across all three languages, including precedence tests

Hope this absolutely unimportant but preventing-many-confusions change will be helpful!

krystof-k and others added 20 commits April 23, 2026 13:25
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…tion

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Kryštof Korb <krystof@korb.cz>

@marcoroth marcoroth left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @krystof-k, thanks for the pull request.

I have been following the convention established by most Ruby tools and configuration files that also Rails ships with, which all use .yml.

So I'm not sure if we should be using .yaml, as that might be unusual and unexpected for most users.

@krystof-k

Copy link
Copy Markdown
Author

Hi @marcoroth, so at least someone needs to have it right ;)

Jokes aside, fair point — I understand the Ruby/Rails convention around .yml. My thinking here was less about forcing a switch and more about reducing friction: .yaml is the official YAML extension and some people (like me) reach for it first and are surprised it doesn't work. Supporting both feels like the least surprising behavior, while keeping full backwards compatibility with existing .yml files.

Whether Herb should prefer .yaml in generated examples/docs is totally your call. I intentionally kept those changes isolated in a separate commit so they can be reverted easily.

krystof-k and others added 5 commits July 3, 2026 15:53
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…hFromProjectPath

The bare require('fs') call was preserved verbatim in the ESM bundle
(rollup format 'esm', fs external), so any Node ESM consumer constructing
a Config without an explicit configPath crashed with
"ReferenceError: require is not defined".

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…path

Status bar, config views, quick-fix titles, warning-popup buttons, and
version-mismatch warnings hardcoded .herb.yaml even when the loaded
config file was the legacy .herb.yml, pointing users at a file that
doesn't exist in their project. Messages that direct the user to the
config file now use the basename of the resolved path; messages that
only describe configuration state drop the filename. Creation flows
intentionally keep the .herb.yaml default.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…essages

Messages like "disabled in .herb.yaml" named the wrong file in projects
using legacy .herb.yml — and following "set formatter.enabled: true in
.herb.yaml" literally would create a second config file that shadows
the existing one. Runtime messages now interpolate the loaded config's
basename; only creation flows (--init tips, help text) keep the
.herb.yaml default, and "No .herb.yaml found" becomes "No Herb config
file found" since neither file exists at that point.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Discovery silently prefers .herb.yaml, so a stray second config file
would shadow all settings in the other with no indication anywhere.
The CLI now prints a warning when it finds more than one config file
in the project root.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants